<extend name="Public:User/base"/>
<block name="content">
    <div class="all-width my-cols-right info-back-color back-margin-padding col-sm-9 col-lg-9">
        <div class="row">
            <div class="small-search col-sm-12 col-lg-12">
                <!-- row-search start -->
                <div class="row">
                    <div class="small-search-a col-sm-6 col-lg-6 text-center">
                        <a class="collect-btn" style="color: RGB(244,166,36)" href="{:U('Home/OrderInfo/order?type=0')}">全部订单</a>
                        <a class="collect-btn" href="{:U('Home/OrderInfo/order?type=1')}">拼购订单</a>
                        <a class="collect-btn" href="{:U('Home/OrderInfo/order?type=2')}">购物订单</a>
                    </div>
                    <div class="col-sm-6 col-lg-6"></div>
                </div>
                <!--row-search end-->
            </div>
        </div>
        <div class="row"><br>
            <div class="goods-status btn-group col-sm-offset-1 col-lg-offset-1 col-sm-3 col-lg-3">
                <button disabled type="button" class="down-select btn" style="width:130px;">
                    <if condition="$Think.session.time eq 1">最近一个月
                        <elseif condition="$Think.session.time eq 3"/>最近三个月
                        <elseif condition="$Think.session.time eq 6"/>最近半年
                        <elseif condition="$Think.session.time eq 12"/>最近一年
                        <else/>全部
                    </if>
                </button>
                <button type="button" class="down-select btn dropdown-toggle" data-toggle="dropdown">
                    <span class="caret"></span>
                    <span class="sr-only">切换下拉菜单</span>
                </button>
                <ul class="dropdown-menu" role="menu" style="margin: 2px 10px;">
                    <li><a href="{:U('Home/OrderInfo/order?time=1')}">最近一个月</a></li>
                    <li><a href="{:U('Home/OrderInfo/order?time=3')}">最近三个月</a></li>
                    <li><a href="{:U('Home/OrderInfo/order?time=6')}">最近半年</a></li>
                    <li><a href="{:U('Home/OrderInfo/order?time=12')}">最近一年</a></li>
                    <li class="divider"></li>
                    <li><a href="{:U('Home/OrderInfo/order?time=1000')}">全部</a></li>
                </ul>
            </div>

            <div class="goods-status btn-group col-sm-3 col-lg-3">
            <if condition="$Think.session.type eq 2">
                    <button disabled type="button" class="down-select btn" style="width:130px;">
                        <if condition="$Think.session.status eq 1">待付款
                            <elseif condition="$Think.session.status eq 2"/>待发货
                            <elseif condition="$Think.session.status eq 3"/>待收货
                            <elseif condition="$Think.session.status eq 4"/>待评价
                            <else/>全部
                        </if>
                    </button>
                    <button type="button" class="down-select btn dropdown-toggle" data-toggle="dropdown">
                        <span class="caret"></span>
                        <span class="sr-only">切换下拉菜单</span>
                    </button>
                    <ul class="dropdown-menu" role="menu" style="margin: 2px 10px;">
                    <li><a href="{:U('Home/OrderInfo/order?status=1')}">待付款</a></li>
                    <li><a href="{:U('Home/OrderInfo/order?status=2')}">待发货</a></li>
                    <li><a href="{:U('Home/OrderInfo/order?status=3')}">待收货</a></li>
                    <li><a href="{:U('Home/OrderInfo/order?status=4')}">待评价</a></li>
                    <li class="divider"></li>
                    <li><a href="{:U('Home/OrderInfo/order?status=0')}">全部</a></li>
                </ul>
            <elseif condition="$Think.session.type eq 1" />
                    <button disabled type="button" class="down-select btn" style="width:130px;">
                    <if condition="$Think.session.status eq 1">正在继续
                            <elseif condition="$Think.session.status eq 2"/>已揭晓
                            <else/>全部
                        </if>
                    </button>
                    <button type="button" class="down-select btn dropdown-toggle" data-toggle="dropdown">
                        <span class="caret"></span>
                        <span class="sr-only">切换下拉菜单</span>
                    </button>
                    <ul class="dropdown-menu" role="menu" style="margin: 2px 10px;">
                        <li><a href="{:U('Home/OrderInfo/order?status=1')}">正在继续</a></li>
                        <li><a href="{:U('Home/OrderInfo/order?status=2')}">已揭晓</a></li>
                        <li class="divider"></li>
                        <li><a href="{:U('Home/OrderInfo/order?status=0')}">全部</a></li>
                    </ul>
                <else />&nbsp;
            </if>
            </div>
            <!-- 搜索表单-->
            <div class=" col-sm-4 col-lg-4" role="form">
                    <form action="#" method="post" name="search" role="search">
                        <div class="input-group" style="margin-top: -10px;">
                            <label class="sr-only"></label><!--form表单中，label标签必不可少-->
                            <input type="text" maxlength="255" autocomplete="off" class="form-control" placeholder="输入商品标题或订单号进行搜索" name="search">
                            <span class="input-group-btn"><button type="submit" class="btn my-btn-default-text btn-default"><i class="icon-search" style="font-size: 18px;"></i></button></span>
                        </div>
                    </form>
            </div><!--搜索框表单-->
            <div class="col-sm-1 col-lg-1"></div>
        </div>
        <!-- table star -->
        <div class="row" style="margin-left: 30px;">
            <div class="col-sm-12 col-lg-12">
                <div class="mypanel panel panel-default text-center" style="border: none;">
                    <table>
                        <thead>
                        <empty name="orderInfo">
                            没有符合条件的订单
                            <else/>
                        <tr class="table-title">
                            <td colspan="2">订单信息</td>
                            <td>单价（元）</td>
                            <td>&nbsp;&nbsp;数量&nbsp;&nbsp;</td>
                            <td>实付款（元）</td>
                            <td>查询</td>
                            <td>&nbsp;&nbsp;操作&nbsp;&nbsp;</td>
                        </tr>
                        </empty>
                        </thead>
                        <tbody>
                        <foreach name="orderInfo" item="v">
                            <if condition="$v['orderid'] neq $temp">
                            <tr class="black-row">
                                <td colspan="7"></td>
                            </tr>
                        <tr class="table-row">
                            <td colspan="7">
                                <span class="pull-left">2015-07-04 <a href="#订单详情">订单号：{$v['orderid']}</a></span>
                                <span class="btn btn-text pull-right icon-trash icon-2x"
                                      onclick="window.location.href ='{:U('Home/OrderInfo/delOrder?id='.$v['orderid'])}' ">
                                    &nbsp;&nbsp;&nbsp;</span>
                                <!--删除功能待实现todo-->
                            </td>
                        </tr>
                            </if>
                            <assign name="temp" value="$v['orderid']" />
                            <tr class="table-row">
                            <td><img src="{$Think.const.IMG_URL}/personalcenter/smart_img.png" height="135" width="130"></td>
                            <td>
                                <a href="#商品名">{$v['goodsname']}</a><br>
                                <!--<a href="#商品型号">这个是商品型号</a>-->
                            </td>
                            <td>{$v['unitprice']}</td>
                            <td>{$v['ordernumber']}</td>
                            <td>{$v['totalmoney']} </td>
                            <td>
                                <if condition="$v.paydate lt '1971-01-01'">
                                    <a href="#交易状态">待付款</a><br>
                                    <elseif condition="($v.paydate gt '1971-01-01') AND ($v.deliverydate lt '1971-01-01') AND ($v.isbingo eq 0)"/>
                                    <a href="{:U('Home/ReturnInfo/showReturn')}">申请退款</a><br>
                                    <a href="#交易状态">已付款</a><br>
                                    <elseif condition="($v.deliverydate gt '1971-01-01') AND ($v.confirmreceiptdate lt '1971-01-01') AND ($v.isbingo eq 0)"/>
                                    <a href="#交易状态">待收货</a><br>
                                    <elseif condition=" $v.confirmreceiptdate gt '1971-01-01'"/>
                                    <if condition="$v.isReturn eq 1">
                                    <a href="{:U('Home/ReturnInfo/findOneReturn?detailId='.$v['detailid'])}">退货中</a><br>
                                    <elseif condition="$v.isReturn eq 0" />
                                    <a href="{:U('Home/ReturnInfo/showReturn')}">退货/换货</a><br>
                                </if>

                                    <a href="#交易状态">交易完成</a><br>
                                </if>
                                <if condition="$v.isbingo eq 0">
                                <a href="{:U('Home/OrderInfo/singleInfo','orderId='.$temp.'&& unitprice='.$v['unitprice'].'&& goodsName='.$v[goodsname])}">查看物流</a><br>
                                </if>
                                <a href="{:U('Home/OrderInfo/singleInfo','orderId='.$temp.'&& unitprice='.$v['unitprice'].'&& goodsName='.$v[goodsname])}">订单详情</a><br>
                            </td>
                            <td>
                                <if condition="($v.isevaluated eq 0) AND ($v.isbingo eq 0)">
                                <a href="#是否评价">待评价</a><br>
                                </if>
                                <a href="#再次购买">再次购买</a><br>
                                <a href="#分享" >分享</a><br>
                            </td>
                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- table end -->
    </div>
</block>